<jsp:useBean
        id="user"
        class="org.goldfish.cookied_chatroom02.entity.UserBean"
        scope="session"
/>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
    <title>登陆聊天室</title>
</head>
<body>
<form action="." method="post" id="login_form">
    <fieldset>
        <label for="login_name_field">请输入姓名
            <input id="login_name_field" type="text"
                   name="name"
                   value="${requestScope.get("name")}">
        </label>
        <br/>
        <label for="login_password_field">请输入密码
            <input id="login_password_field" type="password"
                   name="password"
                   value="${requestScope.get("password")}">
        </label>
        <br/>
        <button type="submit" name="submit_type" value="login">登录</button>
        <br/>
        <label>没有用户？<a href="register">去注册</a></label>
    </fieldset>
</form>
<script type="application/javascript">

    <c:set var="message">
        ${requestScope.get("error_message")}
    </c:set>
    <c:choose>
        <c:when test="${message == null}"/>
        <c:when test="${message == \"\"}"/>
        <c:otherwise>
            alert("${message}")
        </c:otherwise>
    </c:choose>
</script>
</body>
</html>
